<!--title-->
<div class="mnav1">
	<div class="m_nav">
		<div class="nav_left">
			<em class="home_icon"><?=$this->sys_name?></em><span>&nbsp;&gt;&nbsp;</span><font><?=$this->title?></font>
		</div>
	</div>
</div>

<div class="content-table">
<div class="content-table-title"><?=$this->title?></div>
<br />
<?php if($this->msg):?>
<div class="replace"><?=$this->msg?></div>
<br />
<?php endif;?>
<form action="/contracts/invoices" name="form1" method="GET">
状态：
<input type="checkbox" name="status[]" id="status_1" value="1" <?php if(in_array(1, $this->status)){echo "checked='checked'";}?> /> <label for="status_1">待开票</label>&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="status[]" id="status_2" value="2" <?php if(in_array(2, $this->status)){echo "checked='checked'";}?> /> <label for="status_2">已开票</label>&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="status[]" id="status_3" value="3" <?php if(in_array(3, $this->status)){echo "checked='checked'";}?> /> <label for="status_3">已作废</label>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
关键字：<input type="text" name="keyword" <?php if($this->keyword){echo "value='".$this->keyword."'";}?> />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" class="button" value="搜索" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" class="button-cancle" value="清空搜索条件" onclick="location.href='?';" />
&nbsp;&nbsp;&nbsp;&nbsp;
<font color="red"><b>当前搜索结果: 开票记录数 <?=$this->data['ct']?></b></font>
</form>
<br />
<table>
  <tr>
    <th>合同编号</th>
    <th>申请票种</th>
    <th>签约公司</th>
    <th>开票金额</th>
    <th>申请人</th>
    <th>申请日期</th>
    <th>发票号码</th>
    <th>物流信息</th>
    <th>状态</th>
	<?php if("LEVEL-4" == $_SESSION['identity']['level']):?>
    <th>操作</th>
	<?php endif;?>
  </tr>
  <?php $data = $this->data['current_page_info'];?>
  <?php if($data["contract_sid"]):?>
  <?php foreach($data["contract_sid"] as $id => $something):?>
  <tr>
    <td><?=$data["contract_sid"][$id]?></td>
    <td><?=(1==$data["invoice_type"][$id]?"专票":"普票")?></td>
	<td>
		  <?=$data["company_name"][$id]?>
	</td>
    <td><?=$data["invoice_amount"][$id]?></td>
	<td><?=$data["sales_emp_name"][$id]?></td>
	<td><?=$data["ctime"][$id]?></td>
	<td><?=$data["invoice_num"][$id]?($data["invoice_num"][$id]."<br>(".$data["end_time"][$id].")"):""?></td>
	<td><?php if($data["carrier_tracking_num"][$id]):?><?=$data["carrier_name"][$id]?>:<?=$data["carrier_tracking_num"][$id]?><?php endif;?></td>
	<td><?php if(1==$data["status"][$id]){echo "待开票";}elseif(2==$data["status"][$id]){echo "<font color='green'>已开票</font>";}elseif(3==$data["status"][$id]){echo "<font color='grey'>已作废</font>";}?></td>
	<?php if("LEVEL-4" == $_SESSION['identity']['level']):?>
	<td><button onclick="window.location.href='/contracts/invoice-edit/id/<?=$id?>'">编辑</button></td>
	<?php endif;?>
  </tr>
  <?php endforeach;?>
  <?php endif;?>
</table>

<br /><br />
<div align="right"><?=$this->pagination?></div>
<br /><br /><br />